home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5694 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: news.mistral.co.uk!usenet
  2. From: mikebarnard@mistral.co.uk (Mike Barnard)
  3. Newsgroups: comp.lang.c
  4. Subject: Best way to store in program messages?
  5. Date: Tue, 20 Feb 1996 11:54:10 GMT
  6. Organization: Mistral Internet (Brighton)
  7. Message-ID: <4gckb4$77e@news.mistral.co.uk>
  8. NNTP-Posting-Host: l56.mistral.co.uk
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. Hi all.
  12.  
  13. Thanks for your past help.
  14.  
  15. My last question threw up another in my mind. How do you, the pro's
  16. out there, store your in-program messages?
  17.  
  18. So far I havn't written amything of any size at all. I've gotten away
  19. with having a function to display a title in a box and used...
  20.  
  21. char title1[]="The program title";
  22. char title2[]="A copyright message";
  23.  
  24. ...at the start of that function then cprintf'd the line I wanted.
  25. Same with the menu I'm working on now, but putting the menuitem
  26. description in a structure.
  27.  
  28. But supposing I did a text adventure? Hundreds of messages to store.
  29. Or a long list of error messages and other inprogram messages giving
  30. instructions to the user. I'd obviously like them to be stored out of
  31. harms way, not taking up too much memory, but easily accessable. Would
  32. you store them in a seperate file #included into the main file? A
  33. seperate function holding them? It would be nice to have them all in
  34. one place for ease of editing.
  35.  
  36. Also I'm not sure what memory is used by char arrays as opposed to
  37. mallocing (something I havn't touched - yet). I've heard of the heap,
  38. near and far memory, data and code segments... huh? As an extra
  39. question can you point me to a good FAQ/Tutorial on heaps, near and
  40. far etc?
  41.  
  42. OK. That's enough wibbling. I'm using a PC with borland c++3.0. and so
  43. far my programs are all in text mode. And will be for quite a while!
  44. :-)
  45.  
  46. Thanks again.
  47.  
  48. ---
  49. Mic.
  50. From very windy and now snowy Worthing; England.
  51. mikebarnard@mistral.co.uk
  52.  
  53. (I just lost 4 fence panels to the wind here! The cost of
  54. replacing them could have bought me a new windows compiler!)
  55.  
  56.